import axios from './axios'
import qs from 'qs'



export function getPartList() {
    return axios.post('/spare_parts/manage/get_list.do').then(res => {
        return Promise.resolve(res.data)
    }, (err) => {
        return Promise.reject(err)
    })
}

export function getPartDetail(sparePartsId) {
    return axios.post('/spare_parts/manage/get_spare_parts_detail.do',qs.stringify({sparePartsId})).then(res=>{
        return Promise.resolve(res.data)
    },err=>{
        return Promise.reject(err)
    })

}



/*
    产品手册接口
 */

export  function getBType(){
    return axios.post('/classification/get_brochure_list.do ').then(res=>Promise.resolve(res.data))
}

export function getBrochureDetail(typeId) {
    let data = qs.stringify({typeId});
    return axios.post('/brochure/get_brochure_List.do',data).then(res=>{
        return Promise.resolve(res.data)
    })

}



/*
    通用接口
 */

//上传文件
export function upload(formdata) {
    return axios.post('/file/uploadFileCDN.do',formdata,{
        headers:{'Content-Type':'multipart/form-data'}
    }).then(res => {
        return Promise.resolve(res.data)
    })
}


